package cn.ronghuanet.org.domain;

import cn.ronghuanet.basic.domain.BaseDomain;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Department extends BaseDomain {

    @ApiModelProperty(value = "名称",required = true)
    private String name;

    @ApiModelProperty(value = "描述",required = true)
    private String intro;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date createTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date updateTime;
    private Long managerId;

    private Employee manager;   // 一个部门有一个部门经理
    private Long parentId;

    private Department parent;  // 一个部门有一个父部门
    private String path;
    private Integer state;

    private List<Department> children;  // 子部门,一个部门下面有多个子部门
}
